
 <!DOCTYPE html>
 <html lang="en">
 <head>
 	<meta charset="UTF-8">
 	<title>音乐列表</title>
 </head>
 <body>
 	<?php 
header("content-type:text/html;charset=utf-8");
//var_dump($data['goods']);//users来自controller

 ?>
 	 <center><h3>音乐列表</h3></center>
 	 <table align="center" windth ="80%" border="1">
 	 <tr>
 	 	<th>音乐编号</th>
 	 	<th>音乐名</th>
 	 	<th>音乐类别</th>
 	 	<th>歌手</th>
 	 	<th>音乐简介</th>
 	 	<th>专辑</th>
 	 	<th>音乐上传日期</th>
 	 
 	 	
 	 	<th width="80">图片</th>
 	 	<th>操作<a href="index.php?c=goods&m=goodsform">添加</a></th>
 	 </tr>

 	 <?php 
 	 // while($row=mysql_fetch_assoc($result)){
 	 foreach($data['goods'] as $row){
 	 	echo '<tr>';
 	 	echo '<td>'.$row['gid'].'</td>';
 	 	echo '<td>'.$row['goodsname'].'</td>';
 	 	
 	 	switch($row['tid']){
 	 		case '1':$tid="流行";break;
 	 		case '2':$tid="摇滚";break;
 	 		case '3':$tid="民谣";break;
 	 		case '4':$tid="怀旧";break;
 	 		case '5':$tid="治愈";break;
 	 		dafault:$tid="不知道";
 	 	}
 	 	echo '<td>'.$tid.'</td>';
 	 	echo '<td>'.$row['brand'].'</td>';
 	 	
 	 	echo '<td>'.$row['intro'].'</td>';
 	 	echo '<td>'.$row['place'].'</td>';
 	 	echo '<td>'.$row['adddate'].'</td>';
 	 	



		
 	 	echo '<td align="center"><img src="'."../images/".$row['pic'].'"width=60 height=80 alt="无头像"></td>';
 	 	echo '<td><a href="index.php?c=goods&m=editgoods&gid='.$row['gid'].'">修改</a>| <a href="index.php?c=goods&m=delgoods&gid='.$row['gid'].'" onClick="return confirm(\'确定要删除吗？\');">删除</a></td>';
 	 	echo '</tr>';
 	 }
 	 echo '</table>';
 	 // $totalrows=mysql_num_rows($result);
 	 // echo "<table align='center'><tr><td>共有{$totalrows}名用户</td></tr></table>";

 	  ?>
 </body>
 </html>